package com.itheima.bos.base.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.itheima.bos.base.dao.AreaRepository;
import com.itheima.bos.base.service.AreaService;
import com.itheima.bos.domain.Area;

@Service
@Transactional
public class AreaServiceImpl implements AreaService {
	//注入Dao
	@Autowired
	private AreaRepository areaRepository;

	@Override
	public void batchSave(List<Area> areas) {
		areaRepository.save(areas);//Dao批量存入

	}

	@Override
	public Page<Area> findPageData(Specification<Area> specification, Pageable pageable) {
		
		return areaRepository.findAll(specification,pageable);
	}

}
